﻿using System;
using System.Collections.Generic;
using System.Text;

namespace IceDog.DNL.CSharp.DesignPattern.FilterOrCriteriaPattern.ChinesePerson
{
    public class CriteriaSingle:ICriteria
    {
        /// <summary>
        /// 复合标准
        /// </summary>
        /// <param name="persons"></param>
        /// <returns></returns>
        public List<Person> MeetCriteria(List<Person> persons)
        {
            List<Person> list = new List<Person>();
            foreach (Person person in persons)
            {
                if (person.MaritalStatus.ToLowerInvariant().Equals("single"))
                {
                    list.Add(person);
                }
            }
            return list;
        }
    }
}
